package com.atguigu.gmall.juc.thread;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * @author 陈昆昆
 * @version 1.0
 * @date 2020/5/28 9:42
 */
public class ScheduledThreadPoolTest {
    public static void main(String[] args) {
        ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(4);
        for (int i = 0; i < 10 ; i++) {
            scheduledExecutorService.schedule(new Task(),5, TimeUnit.SECONDS);
        }
    }
}
